#include <iostream>

using namespace std;

double suma(double[], int);
void afis(double[], int);
void citire(double[],int &);
void apartine(double [], int);
void medie(double[], int);

int main()
{
    double a[100];
    int n;
    citire(a,n);
    double su=suma(a,n);
    cout<<su<<endl;
    afis(a,n);
    apartine(a,n);
    medie(a,n);
    afis(a,n);
    return 0;
}


void citire(double b[100], int &m)
{
    std::cout<<"n=";
    std::cin>>m;
    for (int i=0;i<m;i++)
    {
       std:: cout<<"a["<<i<<"]=";
       std:: cin>>b[i];
    }
}

double suma(double b[100],int m)
{
    int i;
    double s=0;
    for (i=0;i<m;i++)
        s=s+b[i];
    return s;
}

void afis(double b[100],int m)
{
    for (int i=0;i<m;i++)
        {std::cout<<b[i];
         std::cout<<" ";}
}

